/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.giangnd.btvn2;


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author GIANG
 */
public class B5 {
    public static void main(String[] args) throws IOException {
         BufferedReader br=new BufferedReader(new FileReader("Data/B5.txt"));
         BufferedWriter bf=new BufferedWriter(new FileWriter("Data/B5OUT.txt"));
         String a = null;
         while(br.ready()==true){
            a = br.readLine();
         }
         int dA=0,dB=0,dC=0,i=0,da=0,db=0,dc=0;
         for(i=0;i<a.length();i++)
         if('A'==a.charAt(i))   dA++;
         else if('B'==a.charAt(i))  dB++;
         else if('C'==a.charAt(i))  dC++;
         for(i=0;i<a.length();i++)
         if('A'==a.charAt(i)||'a'==a.charAt(i))   da++;
         else if('B'==a.charAt(i)||'b'==a.charAt(i))  db++;
         else if('C'==a.charAt(i)||'c'==a.charAt(i))  dc++;
         System.out.println("A="+dA+"\nB="+dB+"\nC="+dC+"\na="+da+"\nb="+db+"\nc="+dc);
         bf.write("A="+dA+"\nB="+dB+"\nC="+dC+"\na="+da+"\nb="+db+"\nc="+dc);
         bf.close();
    }
}
